# -*- coding=utf-8 -*-
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.patches as patches

fig = plt.figure(0)

img=matplotlib.image.imread("demo.jpg") # 不能用opencv 那样读取的图像是BGR图像
plt.imshow(img)
currentAxis=plt.gca()
rect=patches.Rectangle((50, 150),200,100, linewidth=1, edgecolor='r', facecolor='none')
currentAxis.add_patch(rect)
plt.text(50, 150, s="hello, kitty | 0.985 ",
                color="white",
                verticalalignment="top",       # 'top', 'bottom', 'center', 'baseline', 'center_baseline'
         )
plt.axis('off')
plt.savefig("demo_matplot.png", bbox_inches="tight", pad_inches=0.0)
plt.show()


# In[ ]:




